/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tubes1sister.tracker;

import java.net.ServerSocket;
import java.net.Socket;

/**
 *
 * @author Muhammad Anis
 */
public class TrackerServer{
    
    static int port = 9990; //port where the tracker is listening
    static int maxConnection = 100;
    static int currentConnection = 0;
    public static void main(String[] args){
        try{
            ServerSocket listener = new ServerSocket(port);
            Socket server;
            while(currentConnection++ < maxConnection){
                System.out.println("Menunggu Client");
                System.out.println("Koneksi ke: " + currentConnection);
                TrackerHandler tracker;
                server = listener.accept();
                tracker = new TrackerHandler(server);
                Thread t = new Thread(tracker);
                t.start();

            }
            System.out.println("alksdjla");

        }
        catch(Exception e){
            System.out.println("alksdjla");
        }
    }
    
}
